<?php
  require_once('tpl/header.php');
?>
 <?php 
//连接数据库，接收userlist传来的参数，根据UID从users表中查询档期用户信息
     require_once("../system/loginCheck.php");
	      require_once("../system/dbConn.php");
	      connect();

	$uid=$_GET["uid"];
	$sql="select *from users where uid=$uid";
	$result=mysql_query($sql);//结果集
	$row=mysql_fetch_assoc($result);
	// mysql_fetch_assoc(result)

      ?>

	<h2>请修改用户信息</h2>
	<form action="doUserUpdate.php" method="post" enctype="multipart/form-data">
		<input type="hidden" name="uid" value="<?php echo $row["uid"]; ?>">
		<table class="table table-bordered">
			<tr>
				<td>用户名</td>
				<td><input type="text" name="username" value="<?php echo $row["uname"]; ?>" readonly></td>
			</tr>
			<tr>
				<td>密码</td>
				<td><input type="password" name="password" value="123" required></td>
			</tr>
			<tr>
				<td>性别</td>
				<td><input type="radio" name="gender" value="0" <?php 
				if($row["gender"]==0)echo "checked"; ?>>男
				<input type="radio" name="gender" value="0" <?php 
				if($row["gender"]==1)echo "checked"; ?>>女

					</td>
			</tr>
			<tr>
				<td>生日</td>
				<td><input type="text" name="birthdate" value="<?php echo $row["birthdate"]; ?>" required  ></td>
			</tr>
			<tr>
				<td>头像</td>
				<td><input type="file" name="pic" required >
                 原头像<img class="img-circle" src="../images/<?php echo $row["pic"] ?>"width="100px" height="100px" >

				</td>
			</tr>
			<tr>
				<td>邮箱</td>
				<td><input type="email" name="email" value="<?php echo $row["email"] ?>" required></td>
			</tr>
			<tr>
				
				<td colspan="2">
					<input type="submit" value="更新">
					
				</td>
			</tr>
		</table>
		



	</form>
   


<?php
  require_once('tpl/footer.php');
?>